package cn.kgc.tangcco.anyang.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

public class HelloAction2 implements Controller {

	@Override
	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String account = request.getParameter("account");
		String password = request.getParameter("password");
		System.out.println("hello2.action" + "\taccount = " + account + "\tpassword = " + password);
		// request.getRequestDispatcher("/index.jsp").forward(request, response);
		// 创建ModelAndView对象
		ModelAndView modelAndView = new ModelAndView();
		// 向对象中存储值
		modelAndView.addObject("msg","我爱你中国");
		// 向对象中存储视图
		modelAndView.setViewName("/index.jsp");
		return modelAndView;
	}

}
